<template>
  <div>
    <div class="py-1 px-1 bg-white">
      <div v-for="(item, index) in descList" :key="index">
        <custom-details-item :icon="item.icon" :label="item.label" :value="item.value">
          <template #valueSlot>
            <span v-if="item.label !== '附件'">{{ item.value }}</span>
            <el-link v-else type="primary">{{ item.value }}</el-link>
          </template>
        </custom-details-item>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      descList: [
        { label: '企业名称', value: '', fieldName: 'companyName', icon: '&#xe725;' },
        { label: '有限空间名称', value: '', fieldName: 'limitSpaceName', icon: '&#xe87e;' },
        { label: '所在位置', value: '', fieldName: 'location', icon: '&#xe791;' },
        { label: '有限空间类型', value: '', fieldName: 'spaceType', icon: '&#xe791;' },
        { label: '主要危害因素', value: '', fieldName: 'dangerousFactor', icon: '&#xe791;' },
        { label: '责任人', value: '', fieldName: 'head', icon: '&#xe791;' },
        { label: '联系电话', value: '', fieldName: 'phone', icon: '&#xe791;' }
      ]
    }
  },
  created() {
    this.$nextTick(() => {
      this.initFun()
    })
  },
  methods: {
    initFun() {
      this.descList.forEach((v) => {
        v.value = this.$route.query[v.fieldName]
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>

